Ext.define('HIT.view.ImportServerFilePanel', {
    extend: 'Ext.form.Panel',
    alias: 'widget.importserverfilepanel',

    frame: true,
    height: 381,
    width: 604,
//    y:120,
    id: 'import-local-server-panel',
    overlapHeader: false,
    preventHeader: true,
    title: Share.T('导入文件'),
//    title: Share.T('导入文件'),

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'hiddenfield',
                    id: 'import-server-type',
                    value: -1
                },
                {
                    xtype: 'hiddenfield',
                    id: 'import-function-id',
                    value: 1
                },
                {
                    xtype: 'hiddenfield',
                    id: 'import-cancel',
                    value: -99
                },
                {
                    xtype: 'hiddenfield',
                    id: 'import-ctr-id',
                    value: 1
                },
                {
                	xtype: 'hiddenfield',
                	id: 'server_type_id',
                	value:null
                },
                {
                	xtype: 'hiddenfield',
                	id: 'type_in_server_file',
                	value: '2'
                },
                {
                    xtype: 'fieldset',
                    height: 67,
                    id: 'import-label-server-1',
                    hidden: false,
                    layout: {
                        type: 'absolute'
                    },
                    title: Share.T('文件一'),
                    items: [
                        {
                        	xtype: 'hiddenfield',
                        	id: 'import-server-db1',
                        	value: null
                        },
                        {
                        	xtype: 'hiddenfield',
                        	id: 'import-server-id1',
                        	value: null
                        },
                        {
                            xtype: 'textfield',
                            x: 10,
                            y: 3,
                            id: 'import-text-server-1',
                            width: 450,
                            readOnly: true,
                            fieldLabel: '',
                            emptyText: Share.T('未导入文件...')
                        },
                        {
                            xtype: 'button',
                            x: 490,
                            y: 3,
                            height: 20,
                            id: 'import-btn-server-1',
                            width: 70,
                            text: Share.T('导入...')
                        }
                    ]
                },
                {
                    xtype: 'fieldset',
                    height: 67,
                    id: 'import-label-server-2',
                    layout: {
                        type: 'absolute'
                    },
                    title: Share.T('文件二'),
                    items: [
                        {
                         	xtype: 'hiddenfield',
                          	id: 'import-server-db2',
                           	value: null
                        },
                        {
                         	xtype: 'hiddenfield',
                         	id: 'import-server-id2',
                         	value: null
                        },
                        {
                            xtype: 'textfield',
                            x: 10,
                            y: 3,
                            id: 'import-text-server-2',
                            width: 450,
                            readOnly: true,
                            fieldLabel: '',
                            emptyText: Share.T('未导入文件...')
                        },
                        {
                            xtype: 'button',
                            x: 490,
                            y: 3,
                            height: 20,
                            id: 'import-btn-server-2',
                            width: 70,
                            text: Share.T('导入...')
                        }
                    ]
                },
                {
                    xtype: 'fieldset',
                    height: 67,
                    id: 'import-label-server-3',
                    layout: {
                        type: 'absolute'
                    },
                    title: Share.T('文件三'),
                    items: [
                        {
                           	xtype: 'hiddenfield',
                            id: 'import-server-db3',
                           	value: null
                        },
                        {
                         	xtype: 'hiddenfield',
                         	id: 'import-server-id3',
                         	value: null
                        },
                        {
                            xtype: 'textfield',
                            x: 10,
                            y: 3,
                            id: 'import-text-server-3',
                            width: 450,
                            readOnly: true,
                            fieldLabel: '',
                            emptyText: Share.T('未导入文件...')
                        },
                        {
                            xtype: 'button',
                            x: 490,
                            y: 3,
                            height: 20,
                            id: 'import-btn-server-3',
                            width: 70,
                            text: Share.T('导入...')
                        }
                    ]
                },
                {
                    xtype: 'fieldset',
                    height: 67,
                    id: 'import-label-server-4',
                    layout: {
                        type: 'absolute'
                    },
                    title: Share.T('文件四'),
                    items: [
                        {
                           	xtype: 'hiddenfield',
                           	id: 'import-server-db4',
                           	value: null
                        },
                        {
                        	xtype: 'hiddenfield',
                        	id: 'import-server-id4',
                        	value: null
                        },
                        {
                            xtype: 'textfield',
                            x: 10,
                            y: 3,
                            id: 'import-text-server-4',
                            width: 450,
                            readOnly: true,
                            fieldLabel: '',
                            emptyText: Share.T('未导入文件...')
                        },
                        {
                            xtype: 'button',
                            x: 490,
                            y: 3,
                            height: 20,
                            id: 'import-btn-server-4',
                            width: 70,
                            text: Share.T('导入...')
                        }
                    ]
                },
                {
                    xtype: 'fieldset',
                    height: 67,
                    id: 'import-label-server-5',
                    layout: {
                        type: 'absolute'
                    },
                    title: Share.T('文件五'),
                    items: [
                        {
                           	xtype: 'hiddenfield',
                           	id: 'import-server-db5',
                           	value: null
                        },
                        {
                        	xtype: 'hiddenfield',
                        	id: 'import-server-id5',
                        	value: null
                        },
                        {
                            xtype: 'textfield',
                            x: 10,
                            y: 3,
                            id: 'import-text-server-5',
                            width: 450,
                            readOnly: true,
                            fieldLabel: '',
                            emptyText: Share.T('未导入文件...')
                        },
                        {
                            xtype: 'button',
                            x: 490,
                            y: 3,
                            height: 20,
                            id: 'import-btn-server-5',
                            width: 70,
                            text: Share.T('导入...')
                        }
                    ]
                }
            ],
            listeners: {
                beforerender : function(comp, options){
                	Share.AjaxRequest({
                        url      : ctx + '/getLabelName',
                        showMsg: false,
                        params   : {
                        },
                        callback : function(json) {
//                      	  console.log(json);
                      	  if(json.data){
                      		if(json.data[0].t1){
                  			  try{
                  				Ext.getCmp('import-label-server-1').setTitle(Share.T(json.data[0].t1));
                  			  }catch(e){}
                  		  }else{
                  			try{
                  				Ext.getCmp('import-label-server-1').setTitle(Share.T("文件一"));
                  			  }catch(e){}
                  		  }
                  		  if(json.data[0].t2){
                  			try{
                  				Ext.getCmp('import-label-server-2').setTitle(Share.T(json.data[0].t2));
                  			  }catch(e){}
                  		  }else{
                  			try{
                  				Ext.getCmp('import-label-server-2').setTitle(Share.T("文件二"));
                  			  }catch(e){}
                  		  }
                  		  if(json.data[0].t3){
                  			try{
                  				Ext.getCmp('import-label-server-3').setTitle(Share.T(json.data[0].t3));
                  			  }catch(e){}
                  		  }else{
                  			try{
                  				Ext.getCmp('import-label-server-3').setTitle(Share.T("文件三"));
                  			  }catch(e){}
                  		  }
                  		  if(json.data[0].t4){
                  			try{
                  				Ext.getCmp('import-label-server-4').setTitle(Share.T(json.data[0].t4));
                  			  }catch(e){}
                  		  }else{
                  			try{
                  				Ext.getCmp('import-label-server-4').setTitle(Share.T("文件四"));
                  			  }catch(e){}
                  		  }
                  	  	  if(json.data[0].t5){
                  	  	try{
                  	  	Ext.getCmp('import-label-server-5').setTitle(Share.T(json.data[0].t5));
              			  }catch(e){}
                  	  	  }else{
                  	  	try{
                  	  	Ext.getCmp('import-label-server-5').setTitle(Share.T("文件五"));
              			  }catch(e){}
                  	  	  }
                      	  }
                        }
                    });
                	Ext.Ajax.request({
                		url      : ctx + '/ReLoadHardDiskFiles',  //FileUploadController.java
                        showMsg: false,
                        params   : {
                        },
                        callback : function(json) {
                        	
                        }
                	});
                }
            }
        });

        me.callParent(arguments);
    }
});